/*
2020-10-24 周六 制作
*/
#include <stdio.h>
int main()
{
	int endswith(char *str,char *substr);
	char ch1,ch2;
	printf("ch1 endswith ch2:");
	scanf("%s%s",&ch1,&ch2);
	if(endswith(&ch1,&ch2)==1)
	{
		printf("Yes!\n");
	}
	else{printf("No!\n");}
	return 0;
}

int endswith(char *str,char *substr)
{
	int strlen=0;
	while(*str!='\0')
	{
		str++;
		strlen++;
	}
	int substrlen=0;
	while(*substr!='\0')
	{
		substr++;
		substrlen++;
	}
	if(substrlen>strlen)
	{
		return 0;
	}
	for(int i=0;i<=substrlen;i++)
	{
		char ch1=*str;
		char ch2=*substr;
		if(ch1!=ch2)
		{
			return 0;
		}
		str--;
		substr--;
	}
	return 1;
}